//********************************************************************************************************************//
//ORGANIZATION:
//AUTHOR: bpeng(bogers.peng@gmail.com)
//SUMMARY:
//********************************************************************************************************************//
#ifndef NATIVE_DOMAIN_COMPILING_COMMON_GATHER_H
#define NATIVE_DOMAIN_COMPILING_COMMON_GATHER_H

#ifndef NATIVE_SYSTEM_BASE_OBJECT_H
#include "System/Base/Object.h"
#endif
#ifndef NATIVE_SYSTEM_BASE_TYPES_H
#include "System/Base/Types.h"
#endif
#ifndef NATIVE_DOMAIN_COMPILING_COMMON_FIELD_H
#include "Domain/Compiling/Common/Field.h"
#endif

namespace Native { namespace Compiling
{
    //****************************************************************************************************************//
    //CGather
    //
    //****************************************************************************************************************//
    NATIVE_DECLARE_CONST_OBJECT(CGather, C_GATHER);
    class NATIVE_LIBRARY_EXPORT CGather :
        public CObject
    {
        NATIVE_DECLARE_OBJECT;

    protected:
        CField _field;
        CMap<CString, CString> _properies;

    public:
        CGather();
        CGather(C_GATHER& that);
        CGather(C_GATHER&& that);
        virtual ~CGather();
        //{CGather
        virtual void Update() const;
        virtual void Clear();
        //}
        void Collect(C_STRING& name, C_STRING& value) throw();
        CString Get(C_STRING& name) throw();
        CString& Get(C_STRING& name) const throw();
        void CollectStarting(size_t starting);
        void CollectEnding(size_t ending);
        void CollectSequence(size_t sequence);

        virtual C_GATHER& operator=(C_GATHER& rvalue);
    };
    
}}

#endif